// @ts-ignore
/* eslint-disable */
import request from '@/utils/request';

/** 新增题库 POST /api/banks/add */
export async function addBankUsingPost(body: API.QuestionBank, options?: { [key: string]: any }) {
  return request<API.ResponseResultBoolean_>('/api/banks/add', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 查询全部 POST /api/banks/all */
export async function allBankUsingPost(body: API.BankQueryDto, options?: { [key: string]: any }) {
  return request<API.ResponseResultListQuestionBank_>('/api/banks/all', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除题库 POST /api/banks/delete */
export async function deleteBankUsingPost(
  body: API.DeleteRequest,
  options?: { [key: string]: any },
) {
  return request<API.ResponseResultBoolean_>('/api/banks/delete', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 分页查询 POST /api/banks/list */
export async function listBankUsingPost(body: API.BankQueryDto, options?: { [key: string]: any }) {
  return request<API.ResponseResultPageQuestionBank_>('/api/banks/list', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 查询题库详情 GET /api/banks/queryDetail */
export async function queryBankDetailByIdUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.queryBankDetailByIdUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<API.ResponseResultBankDetailVo_>('/api/banks/queryDetail', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 修改题库信息 POST /api/banks/update */
export async function updateBankUsingPost(
  body: API.QuestionBank,
  options?: { [key: string]: any },
) {
  return request<API.ResponseResultBoolean_>('/api/banks/update', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
